Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate users scraping #124

Merged
merged 9 commits into from
Jul 10, 2024
Merged

Automate users scraping #124

merged 9 commits into from
Jul 10, 2024

Conversation

nurbal
Copy link
Collaborator

@nurbal nurbal commented May 27, 2024

This PR's goal is to fix some details about acquire users:

  • implement a workaround for the NotImplementedException raised by fetch_mymila, until the PR Add mymila fields #120 is finally merged (still some problems parsing the mymila dump csv, with some specific limit cases)
  • automate the daily LDAP import

@nurbal nurbal marked this pull request as ready for review May 27, 2024 19:07
@nurbal
Copy link
Collaborator Author

nurbal commented Jun 3, 2024

This PR may introduce a bug resulting in database inflation (Jira ticket : https://mila-iqia.atlassian.net/browse/SARC-363)

@nurbal nurbal marked this pull request as draft June 3, 2024 17:57
@nurbal
Copy link
Collaborator Author

nurbal commented Jun 3, 2024

database inflation bug solved :)

@nurbal nurbal marked this pull request as ready for review June 3, 2024 22:45
@nurbal nurbal requested a review from bouthilx June 4, 2024 12:47
# MyMila scraping "NotImplementedError" is temporary ignored until we have a working fetching implementation,
# or a working workaround using CSV cache.
with using_trace(
"sarc.ldap.acquire", "fetch_mymila", exception_types=(NotImplementedError,)
Copy link
Collaborator Author

@nurbal nurbal Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je l'ai fait comme ça, de manière à gérer les deux cas:

  • en l'absence de fichier CSV de mymila (dans ce cas la lecture du cache échoue), fetch_mymila est appelée, une exception "Not Implemented" est lancée et gracieusement catchée, et MonMila est donc simplement ignoré
  • si on a le CSV, il est manuellement placé dans le répertoire de cache et directement lu.

Pour l'heure le traitement de ce fichier est l'objet d'une autre PR ( #120 ) mais pas encore Ok. Donc on ne place simplement pas le CSV en prod et le code fonctionne en l'état.

@nurbal nurbal merged commit 76e8345 into master Jul 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant